package per.dg.retrofittestkotlin.use

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.Field

class RetrofitHttpManager private constructor(): IHttpManager {

    companion object{
        val INSTANCE : RetrofitHttpManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) { RetrofitHttpManager() }
    }

    var wanAndroidApi : WanAndroidApi

    init {
        val retrofit : Retrofit = Retrofit.Builder()
            .addConverterFactory(GsonConverterFactory.create())
            .baseUrl("https://www.wanandroid.com")
            .build()
        wanAndroidApi = retrofit.create(WanAndroidApi::class.java)
    }

}